package com.hnas.ecard.mapper;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.hnas.core.mapper.Mapper;
import com.hnas.ecard.orm.ECardChannelInfo;
import com.hnas.ecard.service.dto.DTOECardChannelInfo;

public class ECardChannelInfoMapper extends Mapper<DTOECardChannelInfo, ECardChannelInfo>{

	private static ECardChannelInfoMapper mapper;
	private ECardChannelInfoMapper(){
		super(DTOECardChannelInfo.class,ECardChannelInfo.class);
	}
	public static ECardChannelInfoMapper getInstance(){
		if(mapper == null){
			mapper = new ECardChannelInfoMapper();
		}
		return mapper;
	}
	public DTOECardChannelInfo mapToValue(ECardChannelInfo vo){
		if(vo == null) return null;
		DTOECardChannelInfo dto = new DTOECardChannelInfo();
		BeanUtils.copyProperties(vo, dto);
		return dto;
	}
	public List<DTOECardChannelInfo> mapToValue(List<ECardChannelInfo> list){
		if(list == null) return null;
		List<DTOECardChannelInfo> dtoList = new ArrayList<DTOECardChannelInfo>();
		for(ECardChannelInfo vo : list){
			dtoList.add(mapToValue(vo));
		}
		return dtoList;
	}
	
}
